import baseRequest from "@/common/js/request.js"

/**
 * 获取字典列表
 * @param dictType
 */
function getDictList(dictType) {
	return baseRequest('/jcApi/dict/listByType', {dictType})
}

/**
 * 获取区域列表
 */
function getAreaList() {
	return baseRequest('/jcApi/area/list')
}

/**
 * 获取我的收藏列表
 * @param params
 * @returns {Promise | Promise<any>}
 */
function getCollectPageList(params) {
	return baseRequest('/jcApi/collect/pageList', params)
}

/**
 * 保存收藏
 * @param type
 * @param typeId
 * @param isCancel
 */
function saveCollect(type, typeId) {
	return baseRequest('/jcApi/collect/save', {type,typeId}, 'POST')
}

/**
 * 删除收藏
 * @param params
 * @returns {Promise | Promise<any>}
 */
function deleteCollect(ids) {
	return baseRequest('/jcApi/collect/delete', {ids}, 'POST')
}

export{
	getDictList,
	getAreaList,
	getCollectPageList,
	saveCollect,
	deleteCollect
}